<template>
	<view class="container">
		 <myp-navbar title="更改昵称" :lefts="lefts" :rights=rights @leftAction="back" @rightAction="save"></myp-navbar>
		 
		 <myp-input type="text" :value="nickName" valueStyle="padding:5rpx; margin:10rpx" placeStyle="padding:5rpx; margin:10rpx" boxStyle="margin-top:20rpx" ></myp-input>
	</view>
</template>

<script>
	export default {
		created() {
			this.user = uni.getStorageSync('user');
			console.info(this.user);
			if(this.user == null) {
				this.$Router.replaceAll({name: "login"});
			}
			this.nickName = this.user.nickName;
		},
		data() {
			return {
				nickName: "",
				user: null,
				lefts: [
					{icon: 'left'}
				],
				rights: [
					{
						text: '保存',
						style: "background: #07ff55;padding-left:25rpx;padding-right:25rpx;padding-top:15rpx;padding-bottom:15rpx;border-radius:5rpx ",
						textStyle: "color: #f9f9f9;font-weight:bold"
					}
				]
			}
		},
		methods:{
			back(){
				this.$Router.back();
			},
			save() {
				
			}
		}
	}
</script>

<style>
	@import url("/static/global.css");
	.container {
		width: 750rpx;
		background: #e6e6e6;
	}
	
</style>
